package com.zx.controller;

import com.sun.net.httpserver.HttpServer;
import com.zx.bean.IndexIndastrial;
import com.zx.dao.IndexIndastrialDao;
import com.zx.dao.impl.IndexIndastrialImpl;
import com.zx.mvc.ResponseBody;


import javax.persistence.CollectionTable;
import javax.servlet.Servlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


public class IndexIndastrialController {
    IndexIndastrialDao dao=new IndexIndastrialImpl();
    @ResponseBody("/indexindastrial/insert.do")
    public String insert(HttpServletRequest request,HttpServletResponse response){
        IndexIndastrial entity = new IndexIndastrial();
         String firmName=request.getParameter("firmName");entity.setFirmName(firmName);
         String firmNo=request.getParameter("firmNo");entity.setFirmNo(firmNo);
         int DataYear;
         int DataMonth;
         String safty=request.getParameter("safty");entity.setSafty(safty);
         int saftyGrade;
         String complexUse=request.getParameter("complexUse");entity.setComplexUse(complexUse);
         int complexUseGrade;
         String weather=request.getParameter("weather");entity.setWeather(weather);
         int weatherGrade;
         String EEUE=request.getParameter("EEUE");entity.setEEUE(EEUE);
         int EEUEGrade;
         String ITEquipment=request.getParameter("ITEquipment");entity.setITEquipment(ITEquipment);
         int ITEquipmentGrade;
         String cooling=request.getParameter("cooling");entity.setCooling(cooling);
         int coolingGrade;
         String OtherEquipment=request.getParameter("otherEquipment");entity.setOtherEquipment(OtherEquipment);
         int otherEquipmentGrade;
         String PowerSystem=request.getParameter("PowerSystem");entity.setPowerSystem(PowerSystem);
         int powerSystemGrade;
         String energySavingTeam=request.getParameter("energySavingTeam");entity.setEnergySavingTeam(energySavingTeam);
         int energySavingTeamGrade;
         String workingSystem=request.getParameter("workingSystem");entity.setWorkingSystem(workingSystem);
         int workingSystemGrade;
         String otherSystem=request.getParameter("otherSystem");entity.setOtherSystem(otherSystem);
         int otherSystemGrade;
         String newTypeSavingTechnology=request.getParameter("newTypeSavingTechnology");entity.setNewTypeSavingTechnology(newTypeSavingTechnology);
         int newTypeSavingTechnologyGrade;
         String environmentalProtectionTechnology=request.getParameter("environmentalProtectionTechnology");entity.setEnvironmentalProtectionTechnology(environmentalProtectionTechnology);
         int environmentalProtectionTechnologyGrade;
         String environmentalProtectionProduction=request.getParameter("environmentalProtectionProduction");entity.setEnvironmentalProtectionProduction(environmentalProtectionProduction);
         int     environmentalProtectionProductionGrade;
         boolean flag=dao.insert(entity);
         if(flag){
             return "插入成功";
         }
        return "插入失败";
    }
    @ResponseBody("/indexindastrial/findByPage")
    public String findByPage(HttpServletRequest request,HttpServletResponse response){
        int offset=Integer.parseInt(request.getParameter("offset"));
        int pageNumber=Integer.parseInt(request.getParameter("pageNumber"));
        return null;
    }

}
